package com.guaoran.other.decorator;

public class UserForThirdServiceImpl implements UserForThirdService {

    private UserService service;
    public UserForThirdServiceImpl(UserService service){
        this.service = service;
    }

    @Override
    public boolean register(String username, String password) {
        return service.register(username,password);
    }

    @Override
    public boolean login(String username, String password) {
        return service.login(username,password);
    }


    public boolean loginForQQ(String openId){
        return loginForRegist(openId,null);
    }

    public boolean loginForWechat(String openId){
        return false;
    }

    public boolean loginForRegist(String username,String password){
        this.register(username,null);
        return this.login(username,null);
    }

}
